package util;

public class Pageation {
	public static String getPagination(int pageNum, int pageCount,
			int recordCount, String pageUrl) {
		String url = pageUrl.contains("?") ? pageUrl : pageUrl + "?";
		StringBuffer buffer = new StringBuffer();
		buffer.append("��" + pageNum + "/" + pageCount + "ҳ��" + recordCount
				+ "��¼");
		buffer.append(pageNum == 1 ? "��һҳ" : "<a href='" + url
				+ "'&pageNum=1>��һҳ</a>");
		buffer.append(pageNum == 1 ? "��һҳ" : "<a href='" + url + "&pageNum="
				+ (pageNum - 1) + "'>��һҳ</a>");
		buffer.append(pageNum == 1 ? "��һҳ" : "<a href='" + url + "&pageNum="
				+ (pageNum + 1) + "'>��һҳ</a>");
		buffer.append(pageNum == pageCount ? "���һҳ" : "<a href='" + url
				+ "&pageNum=" + (pageCount) + "'>���һҳ</a>");
		buffer.append("<form method='post' name='myform' action=" + url + "");
		buffer.append("<select name='pageNum'>");
		for (int i = 0; i < pageCount - 1; i++) {
			buffer.append("<option  vlaue=" + i + ">" + i + 1 + "</option>");

		}
		buffer.append("</select>");
		buffer.append("<input type='submit' name='sub' value='��ѯ' />");
		buffer.append("</form>");
		return buffer.toString();

	}

}
